package com.xyz.dao.logic;

import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.dao.CGiftlogDao;
import com.xyz.domain.table.CGiftlog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CGiftlogLogic {

    @Autowired
    private CGiftlogDao cGiftlogDao;

    public CGiftlog add(CGiftlog cGiftlog){
        return cGiftlogDao.insert(cGiftlog);
    }

    public Integer update(CGiftlog cGiftlog){
        return cGiftlogDao.update(cGiftlog);
    }

    public List<CGiftlog> list(CGiftlog cGiftlog, String orderBy){
        return cGiftlogDao.selectList(cGiftlog, orderBy);
    }

    public Integer delete(Integer key){
        return cGiftlogDao.delete(key);
    }

    public PageResponseModel<CGiftlog> pageInfo(CGiftlog cGiftlog, String orderBy, Integer pageNo, Integer pageSize){
        return cGiftlogDao.selectByPageNo(cGiftlog, orderBy, pageNo, pageSize);
    }

}